<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>北京航天公司固定资产管理系统</title>
  <style>
    body{
      background-image: url("/layui/images/face/tus.jpg");
      height:100%;
      width:100%;
      overflow: hidden;
      background-size:cover;
    }
  </style>
  <style>
    html,body {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
    }
    .content {
      width: 300px;
      height: 300px;
      /*background: honeydew;*/
      margin: 0 auto; /*水平居中*/
      position: relative;
      top: 50%; /*偏移*/
      margin-top: -150px;
      padding: 70px 0;
    }

  </style>

<!--  <style type="text/css">-->
<!--    body-->
<!--    {-->
<!--      /*font-family : 华文行楷;*/-->
<!--      font-size : 800px;-->
<!--      font-weight: 900;-->
<!--      color : #f00;-->
<!--    }-->
<!--  </style>-->
</head>
<body>
<center>
<div class="content" ></div>

  <h1>
    <font face="华文行楷" color="white" size="900px">北京航天公司固定资产管理系统</font>
  </h1><br>
  <form  class="layui-form" action="">
    <div class="layui-btn-container" style="margin-top: 30px;">

    </div>
    <div class="layui-inline">
      <div class="layui-form-item">
        <label class="layui-form-label">
          <font color="white">用户名</font>
        </label>
        <div class="layui-input-inline">
          <input type="text" name="uname" lay-verify="title" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">
          <font color="white">密  码</font>
        </label>
        <div class="layui-input-inline">
          <input type="password" name="password" lay-verify="title" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
      </div>
    </div>
  </form>

<!--  <button class="layui-btn" onclick="submitUser()">登录</button><br>-->
<!--  <button data-method="confirmTrans" class="layui-btn" onclick="submitUser()">登录</button><br>-->
  <button type="button" class="layui-btn layui-btn-normal" onclick="submitUser()">登录</button><br>
</center>
</body>
</html>
<script type="text/javascript"  src="/js/jquery-1.8.2.js"></script>
<script type="text/javascript"  src="/layui/layui.all.js" ></script>
<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/layui/images/face/tus.jpg">
<script type="text/javascript">
  var form=layui.form;

  function submitUser(){
    var dataForm = $("form").serialize();
    var user_name = $("input[name='uname']").val();
    var flag1 = true;
    if(user_name==""){
      flag1 = false
      // alert("用户名不能为空！！！");
      // layer.msg("用户名不能为空", {
      //   time: 60000, //60s后自动关闭
      //   btn: ['好的']
      // });
    }else {
      flag1 = true
    }
    var user_password = $("input[name='password']").val();
    var flag2 = true;
    if(user_password==""){
      flag2 = false
      // alert("密码不能为空！！！");
      layer.msg("用户名和密码不能为空", {
        time: 60000, //60s后自动关闭
        btn: ['好的']
      });
    }else {
      flag2 = true
    }

    // var type = $("input[name='type']").val();
    // var flag2 = true;
    // if(type==""){
    //   flag2 = false
    //   alert("用户类型不能为空！！！");
    // }else {
    //   flag2 = true
    // }
    if(flag1 == true && flag2 == true){
      $.post("/user/codeLogin?"+dataForm,function (res) {
        console.log(res)
        if(res.code == 0){
          // alert("登陆成功")
          // layer.msg('登录成功', {
          //   time: 600000, //600s后自动关闭
          //   btn: ['好的']
          // });
          location.href="/jump/goIndex";
        }else {
          // alert(res.msg)
          layer.msg(res.msg, {
            time: 60000, //60s后自动关闭
            btn: ['好的']
          });
        }
      })
    }



  }
</script>